home *** CD-ROM | disk | FTP | other *** search
-
- /* File : fillpoly.c */
- /* Entered by : A. Wayner */
- # include <graphics.h>
- # include <stdlib.h>
-
- int triangle[] = { 100, 100, 150, 50, 200, 100 };
- main()
- {
- int graphdriver = DETECT, graphmode;
-
- int numpt;
-
- numpt = sizeof( triangle )/(2* sizeof( int ));
-
- /* Detect adapter type and initialize */
- /* graphics system */
- initgraph( &graphdriver, &graphmode, "\\turboc" );
- outtextxy( 10, 10, "Demonstrating fillpoly");
-
- /* Use fillpoly to draw the filled figure */
- setfillstyle( SOLID_FILL, LIGHTMAGENTA );
- fillpoly( numpt, triangle );
-
- /* Wait until user presses a key */
- outtextxy( 10, getmaxy() - 50, "Press any key to exit");
-
- getch();
- closegraph();
- }
-
-